import { ADD_PERSON } from '../constant'

const initialValue = [{
    name: 'Tom',
    age: 89
}]
export default function personReducer(preState = initialValue, action) {
    const { type, data } = action
    switch (type) {
        case ADD_PERSON:
            return [...preState, data]
        default:
            return preState
    }
}